<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
	Throwable e = (Throwable) request.getAttribute("EXCEPTION");
%>
<html>
<head>
<title><%=e == null ? "系统" : "出错"%>提示</title>
</head>
<body>
<h2 class="title"><%=e == null ? "系统提示": "<a onclick=\"$('#errors').toggle();\">哦，出错了！</a>"%></h2>
<br />
<s:actionerror />
<error-msg>
<s:property value="#request.ERROR_MSG" escape="false" />
</error-msg>
<%
	if (e != null) {
%>
<br />
<div id="errors" style="display: none; text-align: left;">
<h3>错误原因</h3>
<%
	Throwable ce = e;
		for (; ce != null; ce = ce.getCause()) {
			out.println(ce + "<br />");
		}
		out.println("<h3>错误堆栈</h3>");
		StackTraceElement[] stacks = e.getStackTrace();
		for (int i = 0; i < stacks.length; i++) {
			String str = stacks[i] + "<br />";
			if (str.startsWith("cq.nfs")) {
				out.println(str);
			}
		}
%>
</div>
<br />
<%
	}
%>
</body>
</html>